<?php
# MantisBT - a php based bugtracking system
# Copyright (C) 2002 - 2013  MantisBT Team - mantisbt-dev@lists.sourceforge.net
# MantisBT is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# MantisBT is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with MantisBT.  If not, see <http://www.gnu.org/licenses/>.

auth_reauthenticate( );
access_ensure_global_level( config_get( 'manage_plugin_threshold' ) );

html_page_top( lang_get( 'plugin_format_title' ) );

print_manage_menu( );

?>

<br />
<form action="<?php echo plugin_page( 'email/email_update' )?>" method="post">
	<?php echo form_security_field( 'plugin_MRMailNotificationManager_email_update' ) ?>
	<table align="center" class="width50" cellspacing="1">

		<tr>
			<td class="form-title" colspan="2"><?php echo lang_get( 'plugin_MRMailNotificationManager_title' ) . ": " . lang_get( 'plugin_MRMailNotificationManager_page_email' )?>
			</td>
		</tr>
		
		<div align="center"><p>
		<span class="bracket-link">[&nbsp;<a href="plugin.php?page=MRMailNotificationManager/notifications/notifications"><?php echo lang_get( 'plugin_MRMailNotificationManager_page_notifications' ) ?></a>&nbsp;]</span>
		<span class="bracket-link">[&nbsp;<?php echo lang_get( 'plugin_MRMailNotificationManager_page_email' ) ?>&nbsp;]</span>
		<span class="bracket-link">[&nbsp;<a href="plugin.php?page=MRMailNotificationManager/templates/templates"><?php echo lang_get( 'plugin_MRMailNotificationManager_page_templates' ) ?></a>&nbsp;]</span>
		</p></div>

		<tr <?php echo helper_alternate_class( )?>>
			<td class="category" width="40%"><?php echo lang_get( 'plugin_MRMailNotificationManager_server' )?>
			</td>
			<td class="left" width="50%"><input type="text" size="40" name="server"
				value="<?php echo( plugin_config_get('server')) ?>" />
			</td>
		</tr>

		<tr <?php echo helper_alternate_class( )?>>
			<td class="category" width="40%"><?php echo lang_get( 'plugin_MRMailNotificationManager_port' )?>
			</td>
			<td class="left" width="50%"><input type="text" size="10" name="port"
				value="<?php echo( plugin_config_get('port')) ?>" />
			</td>
		</tr>
		
		<tr <?php echo helper_alternate_class( )?>>
			<td class="category" width="40%"><?php echo lang_get( 'plugin_MRMailNotificationManager_method' )?>
			</td>
			<td class="left" width="50%">
				<input type="radio" name="method" value="mail"
				<?php echo (plugin_config_get( 'method') == "mail") ? "checked" : "" ?>> mail()

				<input type="radio" name="method" value="sendmail"
				<?php echo (plugin_config_get( 'method') == "sendmail") ? "checked" : "" ?>> Sendmail

				<input type="radio" name="method" value="smtp"
				<?php echo (plugin_config_get( 'method') == "smtp") ? "checked" : "" ?>> SMTP
			</td>
		</tr>
		
		<tr <?php echo helper_alternate_class( )?>>
			<td class="category" width="40%"><?php echo lang_get( 'plugin_MRMailNotificationManager_authentication' )?>
			<sup>1</sup>
			</td>
			<td class="left" width="50%">
				<input type="radio" name="authentication" value="yes"
				<?php echo (plugin_config_get( 'authentication') == "yes") ? "checked" : "" ?>>
				<?php echo lang_get( 'plugin_MRMailNotificationManager_authentication_yes' )?>

				<input type="radio" name="authentication" value="no"
				<?php echo (plugin_config_get( 'authentication') == "no") ? "checked" : "" ?>>
				<?php echo lang_get( 'plugin_MRMailNotificationManager_authentication_no' )?>
			</td>
		</tr>
		
		<tr <?php echo helper_alternate_class( )?>>
			<td class="category" width="40%"><?php echo lang_get( 'plugin_MRMailNotificationManager_protocol' )?>
			</td>
			<td class="left" width="50%">
				<input type="radio" name="protocol" value="none"
				<?php echo (plugin_config_get( 'protocol') == "none") ? "checked" : "" ?>>
				<?php echo lang_get( 'plugin_MRMailNotificationManager_protocol_none' )?>

				<input type="radio" name="protocol" value="ssl"
				<?php echo (plugin_config_get( 'protocol') == "ssl") ? "checked" : "" ?>> SSL

				<input type="radio" name="protocol" value="tls"
				<?php echo (plugin_config_get( 'protocol') == "tls") ? "checked" : "" ?>> TLS
			</td>
		</tr>
		
		<tr <?php echo helper_alternate_class( )?>>
			<td class="category" width="40%"><?php echo lang_get( 'plugin_MRMailNotificationManager_from_name' )?>
			</td>
			<td class="left" width="50%"><input type="text" size="40" name="from_name"
				value="<?php echo( plugin_config_get('from_name')) ?>" />
			</td>
		</tr>

		<tr <?php echo helper_alternate_class( )?>>
			<td class="category" width="40%"><?php echo lang_get( 'plugin_MRMailNotificationManager_from_email' )?>
			</td>
			<td class="left" width="50%"><input type="text" size="40"
				name="from_email" value="<?php echo( plugin_config_get('from_email')) ?>" />
			</td>
		</tr>

		<tr <?php echo helper_alternate_class( )?>>
			<td class="category" width="40%"><?php echo lang_get( 'plugin_MRMailNotificationManager_from_pass' )?>
			</td>
			<td class="left" width="50%"><input type="text" size="40" name="from_pass"
				value="<?php echo( plugin_config_get('from_pass')) ?>" />
			</td>
		</tr>
		
		<tr <?php echo helper_alternate_class( )?>>
			<td class="category" width="40%"><?php echo lang_get( 'plugin_MRMailNotificationManager_subject' )?>
			</td>
			<td class="left" width="50%"><input type="text" size="40" name="subject"
				value="<?php echo( plugin_config_get('subject')) ?>" />
			</td>
		</tr>
		
		<tr <?php echo helper_alternate_class( )?>>
			<td class="category" width="40%"><?php echo lang_get( 'plugin_MRMailNotificationManager_replyto_name' )?>
			</td>
			<td class="left" width="50%"><input type="text" size="40" name="replyto_name"
				value="<?php echo( plugin_config_get('replyto_name')) ?>" />
			</td>
		</tr>

		<tr <?php echo helper_alternate_class( )?>>
			<td class="category" width="40%"><?php echo lang_get( 'plugin_MRMailNotificationManager_replyto_email' )?>
			</td>
			<td class="left" width="50%"><input type="text" size="40"
				name="replyto_email" value="<?php echo( plugin_config_get('replyto_email')) ?>" />
			</td>
		</tr>

		<tr>
			<td class="center" colspan="2">
			<span><sup>1</sup> - <?php echo lang_get( 'plugin_MRMailNotificationManager_authentication_description' )?></span>
			</td>
		</tr>

		<tr>
			<td class="center" colspan="2"><input type="submit" class="button"
				value="<?php echo lang_get( 'plugin_MRMailNotificationManager_update_configurations' )?>" />
			</td>
		</tr>

	</table>
</form>

<?php
html_page_bottom();
